package com.tangyuan.ai.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tangyuan.ai.entity.model.AiMaskCategory;
import com.tangyuan.ai.mapper.AiMaskCategoryMapper;
import com.tangyuan.ai.service.AiMaskCategoryService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AiMaskCategoryImpl extends ServiceImpl< AiMaskCategoryMapper,AiMaskCategory> implements AiMaskCategoryService {

    @Override
    public List<AiMaskCategory> getAllMaskCategory() {
        QueryWrapper<AiMaskCategory> wrapper = new QueryWrapper<>();
        wrapper.lambda().orderByAsc(AiMaskCategory::getId);
        return baseMapper.selectList(wrapper);
    }

    @Override
    public AiMaskCategory getMaskCategoryById(Integer id) {
        if(id == null || id == 0){
            return null;
        }
        return baseMapper.selectById(id);
    }
}
